package avicit.im.lantop.basic.libstructuredefine.action.rest;


import avicit.cbb.tabledefine.service.CommTableManagerIntfsService;
import avicit.cbb.techclass.tabledefine.commtempletmanager.action.rest.CommTempletManagerRest;
import avicit.cbb.techclass.tabledefine.commtempletmanager.action.service.CommTempletManagerService;
import avicit.cbb.techclass.tabledefine.commtempletmanager.domain.CbbTempletField;
import avicit.im.lantop.archiveclassmanager.service.ArchiveClassManagerIntfsService;
import avicit.im.lantop.basic.libstructuredefine.action.service.LantopArchiveClassService;
import avicit.im.lantop.basic.libstructuredefine.action.service.impl.LantopArchiveClassService2;
import avicit.im.lantop.basic.libstructuredefine.dao.service.LantopArchiveClassManagerDao;
import avicit.im.lantop.basic.libstructuredefine.domain.LantopArchiveClassT;
import avicit.platform6.commons.utils.web.TreeNode;
import avicit.platform6.core.context.ThreadContextHelper;
import avicit.platform6.core.exception.DaoException;
import avicit.platform6.core.jdbc.Page;
import avicit.platform6.core.rest.msg.ResponseMsg;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@RestController
@Api(tags = "LantopArchiveRest", description = "LantopArchiveRest")
@RequestMapping("/api/avicit/im/lantop/basic/libstructuredefine/action/rest/LantopArchiveRest")
public class LantopArchiveRest {

    private static final Logger LOGGER = LoggerFactory.getLogger(LantopArchiveRest.class);

    @Resource
    LantopArchiveClassService lantopArchiveClassService;

    @Resource
    CommTableManagerIntfsService commTableManagerIntfsService;

    @Resource
    ArchiveClassManagerIntfsService archiveClassManagerIntfsService;

    @Autowired(required = true)
    LantopArchiveClassManagerDao lantopArchiveClassManagerDao;

    @Resource
    LantopArchiveClassService2 lantopArchiveClassService2;

    @Autowired
    private CommTempletManagerService commTempletManagerService;

    @PostMapping("/getParentNodeByParentId")
    @ApiOperation(value = "得到父节点")
    public ResponseMsg<Integer> getParentNodeByParentId(@ApiParam(value = "得到父节点", name = "map") @RequestBody Map<String, Object> map) {
        ResponseMsg<Integer> responseMsg = new ResponseMsg<>();
        try {
            String deptId = (String) map.get("deptId");
            String orgId = (String) map.get("orgId");
            int parentNodeByParentId = lantopArchiveClassService.getParentNodeByParentId(deptId, orgId);
            responseMsg.setResponseBody(parentNodeByParentId);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setRetCode("201");
            responseMsg.setErrorDesc(e.getMessage());
            e.printStackTrace();
        }
        return responseMsg;
    }


    /**
     *  获取顶层节点
     * @param map
     */
    @PostMapping("/saveRootLantopArchiveTabClassVByType")
    @ApiOperation(value = "获取顶层节点")
    public ResponseMsg saveRootLantopArchiveTabClassVByType(@ApiParam(value = "获取顶层节点", name = "map") @RequestBody Map<String, Object> map) {
        ResponseMsg responseMsg = new ResponseMsg();
        try {
            String deptId = (String) map.get("deptId");
            String orgId = (String) map.get("orgId");
            lantopArchiveClassService.saveRootLantopArchiveTabClassVByType(deptId,orgId);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setRetCode("201");
            responseMsg.setErrorDesc(e.getMessage());
            e.printStackTrace();
        }
        return responseMsg;
    }


    /**
     * 查找树节点
     * @param map
     * @return
     */
    @PostMapping("/recurFindTreeNodesByParentId")
    @ApiOperation(value = "查找树节点")
    public ResponseMsg<List<TreeNode>> recurFindTreeNodesByParentId(@ApiParam(value = "查找树节点", name = "map") @RequestBody Map<String, Object> map) {
        ResponseMsg<List<TreeNode>> responseMsg = new ResponseMsg<>();
        try {
            String id = (String) map.get("id");
            int level = (int) map.get("level");
            String orgId = (String) map.get("orgId");
            List<TreeNode> treeNodes = this.lantopArchiveClassService.recurFindTreeNodesByParentId(id, level, orgId);
            responseMsg.setResponseBody(treeNodes);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setRetCode("201");
            responseMsg.setErrorDesc(e.getMessage());
            e.printStackTrace();
        }
        return responseMsg;
    }

    /**
     * 获取公共字段信息
     * @return
     */
    @PostMapping("/getPublicFieldInfo")
    @ApiOperation(value = "得到公共字段")
    public ResponseMsg<List<Map<String, Object>>> getPublicFieldInfo() {
        ResponseMsg<List<Map<String, Object>>> responseMsg = new ResponseMsg<>();
        try {
            List<Map<String, Object>> publicFieldInfo = this.lantopArchiveClassService.getPublicFieldInfo();
            responseMsg.setResponseBody(publicFieldInfo);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setRetCode("201");
            responseMsg.setErrorDesc(e.getMessage());
            e.printStackTrace();
        }
        return responseMsg;
    }

    /**
     * 根据主键加载LantopArchiveClass对象
     * @param id
     * @return
     */
    @PostMapping("/getLantopArchiveClassById")
    @ApiOperation(value = "得到LantopArchive")
    public ResponseMsg<LantopArchiveClassT> getLantopArchiveClassById(@ApiParam(value = "id", name = "id") @RequestBody String id) {
        ResponseMsg<LantopArchiveClassT> responseMsg = new ResponseMsg<>();
        try {
            LantopArchiveClassT lantopArchiveClassById = lantopArchiveClassService.getLantopArchiveClassById(id);
            responseMsg.setResponseBody(lantopArchiveClassById);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setRetCode("201");
            responseMsg.setErrorDesc(e.getMessage());
            e.printStackTrace();
        }
        return responseMsg;
    }


    /**
     * FIXME (获取模板文件夹下子节点数量)
     * @param id
     * @return
     */
    @PostMapping("/getCountByClassFloder")
    @ApiOperation(value = "获取模板文件夹下子节点数量")
    public ResponseMsg<Integer> getCountByClassFloder(@ApiParam(value = "id", name = "id") @RequestBody String id) {
        ResponseMsg<Integer> responseMsg = new ResponseMsg<>();
        try {
            int countByClassFloder = lantopArchiveClassService.getCountByClassFloder(id);
            responseMsg.setResponseBody(countByClassFloder);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setRetCode("201");
            responseMsg.setErrorDesc(e.getMessage());
            e.printStackTrace();
        }
        return responseMsg;
    }


    /**
     * FIXME (删除树节点)
     *
     * @author 刘中华
     * @param nodeId
     * @return
     * @throws Exception
     *             ModelAndView
     * @throws
     */
    @PostMapping("/deleteLantopArchiveClassById")
    @ApiOperation(value = "删除树节点")
    public ResponseMsg deleteLantopArchiveClassById(@ApiParam(value = "删除树节点", name = "nodeId") @RequestBody String nodeId) {
        ResponseMsg responseMsg = new ResponseMsg();
        try {
            lantopArchiveClassService.deleteLantopArchiveClassById(nodeId);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setRetCode("201");
            responseMsg.setErrorDesc(e.getMessage());
            e.printStackTrace();
        }
        return responseMsg;
    }

    /**
     * 插入组织
     * @param deptId
     * @return
     */
    @PostMapping("/getOrgIdByDeptId")
    @ApiOperation(value = "插入组织")
    public ResponseMsg<String> getOrgIdByDeptId(@ApiParam(value = "deptId", name = "deptId") @RequestBody String deptId) {
        ResponseMsg<String> responseMsg = new ResponseMsg<>();
        try {
            String orgIdByDeptId = lantopArchiveClassService.getOrgIdByDeptId(deptId);
            responseMsg.setResponseBody(orgIdByDeptId);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setRetCode("201");
            responseMsg.setErrorDesc(e.getMessage());
            e.printStackTrace();
        }
        return responseMsg;
    }


    /**
     * 删除字段对应设置相关数据
     * @param listTab
     */

    @PostMapping("/deleteLantopMapSet")
    @ApiOperation(value = "删除字段对应设置相关数据")
    public ResponseMsg deleteLantopMapSet(@ApiParam(value = "删除字段对应设置相关数据", name = "listTab") @RequestBody List<Map<String, Object>> listTab) {
        ResponseMsg responseMsg = new ResponseMsg();
        try {
            lantopArchiveClassService.deleteLantopMapSet(listTab);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setRetCode("201");
            responseMsg.setErrorDesc(e.getMessage());
            e.printStackTrace();
        }
        return responseMsg;
    }

    /**
     * 获取oldTableId
     * @param map
     * @return
     */

    @PostMapping("/getCbbTableInfoByNodeIdByIntfs")
    @ApiOperation(value = "获取oldTableId")
    public ResponseMsg<List<Map<String, Object>>> getCbbTableInfoByNodeIdByIntfs(@ApiParam(value = "获取oldTableId", name = "map") @RequestBody Map<String,Object> map) {
        ResponseMsg<List<Map<String, Object>>> responseMsg = new ResponseMsg<>();
        List<Map<String, Object>> cbbTableInfoByNodeIdByIntfs = null;
        try {
            String orgId = (String) map.get("orgId");
            String deptId = (String) map.get("deptId");
            String sysId = (String) map.get("sysId");
            String nodeId = (String) map.get("nodeId");
            cbbTableInfoByNodeIdByIntfs = commTableManagerIntfsService.getCbbTableInfoByNodeIdByIntfs(orgId, deptId, sysId, nodeId, "");
            responseMsg.setResponseBody(cbbTableInfoByNodeIdByIntfs);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setRetCode("201");
            responseMsg.setErrorDesc(e.getMessage());
            e.printStackTrace();
        }
        return responseMsg;
    }


    /**
     *
     * 库结构定义模板树
     * @param map
     * @return
     */
    @PostMapping("/callProcedure")
    @ApiOperation(value = "callProcedure")
    public ResponseMsg callProcedure(@ApiParam(value = "callProcedure", name = "map") @RequestBody Map<String,Object> map) {
        ResponseMsg responseMsg = new ResponseMsg();
        try {
            ArrayList<Object> params = (ArrayList<Object>) map.get("params");
            lantopArchiveClassManagerDao.callProcedure("LANTOP_DATA_P.LANTOP_DATA_V", params);
            responseMsg.setRetCode("200");
        } catch (SQLException throwables) {
            responseMsg.setRetCode("201");
            responseMsg.setErrorDesc(throwables.getMessage());
            throwables.printStackTrace();
        }
        return responseMsg;
    }

    /**
     * 根据节点ID，删除库表信息（所有与库表相关的信息）
     * @param map
     * @return
     */
    @PostMapping("/deleteCbbTableByNodeIdByIntfs")
    @ApiOperation(value = "deleteCbbTableByNodeIdByIntfs")
    public ResponseMsg deleteCbbTableByNodeIdByIntfs(@ApiParam(value = "deleteCbbTableByNodeIdByIntfs", name = "map") @RequestBody Map<String,Object> map) {
        ResponseMsg responseMsg = new ResponseMsg();
        try {
            String orgId = (String) map.get("orgId");
            String deptId = (String) map.get("deptId");
            String sysId = (String) map.get("sysId");
            String nodeId = (String) map.get("nodeId");
            commTableManagerIntfsService.deleteCbbTableByNodeIdByIntfs(orgId, deptId, sysId, nodeId, "0");
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setRetCode("201");
            responseMsg.setErrorDesc(e.getMessage());
            e.printStackTrace();
        }
        return responseMsg;
    }


    /**
     * 删除文件管理冗余树节点数据
     * @param map
     */
    @PostMapping("/deleteRedundancyTreeData")
    @ApiOperation(value = "删除文件管理冗余树节点数据")
    public ResponseMsg deleteRedundancyTreeData(@ApiParam(value = "删除文件管理冗余树节点数据", name = "map") @RequestBody Map<String,Object> map) {
        ResponseMsg responseMsg = new ResponseMsg();
        try {
            String orgId = (String) map.get("orgId");
            String deptId = (String) map.get("deptId");
            String sysId = (String) map.get("sysId");
            Map<String, Object> param = (Map<String, Object>) map.get("param");
            archiveClassManagerIntfsService.deleteRedundancyTreeData(orgId, deptId, sysId, param);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setRetCode("201");
            responseMsg.setErrorDesc(e.getMessage());
            e.printStackTrace();
        }
        return responseMsg;
    }


    /**
     * 添加
     */
    @PostMapping("/insertLantopArchiveClass")
    @ApiOperation(value = "添加")
    public ResponseMsg insertLantopArchiveClass(@ApiParam(value = "添加", name = "lantopArchiveClassNew") @RequestBody LantopArchiveClassT lantopArchiveClassNew) {
        ResponseMsg responseMsg = new ResponseMsg();
        try {
            lantopArchiveClassService.insertLantopArchiveClass(lantopArchiveClassNew);
            responseMsg.setRetCode("200");
        } catch (DaoException e) {
            responseMsg.setRetCode("201");
            responseMsg.setErrorDesc(e.getLocalizedMessage());
            e.printStackTrace();
        }
        return responseMsg;
    }

    /**
     * 更新treePath
     * @param id
     * @return
     */
    @PostMapping("/getTreePath")
    @ApiOperation(value = "更新treePath")
    public ResponseMsg<String> getTreePath(@ApiParam(value = "更新treePath", name = "id") @RequestBody String id) {
        ResponseMsg<String> responseMsg = new ResponseMsg<>();
        try {
            String treePath = lantopArchiveClassService.getTreePath(id);
            responseMsg.setResponseBody(treePath);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setRetCode("201");
            responseMsg.setErrorDesc(e.getMessage());
            e.printStackTrace();
        }
        return responseMsg;
    }

    /**
     * 更新treePath
     * @param lantopArchiveClassNew
     * @return
     */
    @PostMapping("/updateLantopArchiveClass")
    @ApiOperation(value = "更新")
    public ResponseMsg updateLantopArchiveClass(@ApiParam(value = "更新", name = "lantopArchiveClassNew") @RequestBody LantopArchiveClassT lantopArchiveClassNew) {
        ResponseMsg responseMsg = new ResponseMsg();
        try {
            lantopArchiveClassService.updateLantopArchiveClass(lantopArchiveClassNew);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setRetCode("201");
            responseMsg.setErrorDesc(e.getMessage());
            e.printStackTrace();
        }
        return responseMsg;
    }

    /**
     * FIXME (操作数据,格式化后返回前台)
     * @param id
     * @return
     */
    @PostMapping("/getReturnAttribute")
    @ApiOperation(value = "")
    public ResponseMsg<List<Map<String, Object>>> getReturnAttribute(@ApiParam(value = "", name = "id") @RequestBody String id) {
        ResponseMsg<List<Map<String, Object>>> responseMsg = new ResponseMsg<>();
        try {
            List<Map<String, Object>> returnAttribute = lantopArchiveClassService.getReturnAttribute(id);
            responseMsg.setResponseBody(returnAttribute);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setRetCode("201");
            responseMsg.setErrorDesc(e.getMessage());
            e.printStackTrace();
        }
        return responseMsg;
    }

    /**
     * 验证当前组织是否创建全宗信息
     * @param map
     * @return
     */
    @PostMapping("/checkCurrentFonds")
    @ApiOperation(value = "验证当前组织是否创建全宗信息")
    public ResponseMsg<Boolean> checkCurrentFonds(@ApiParam(value = "验证当前组织是否创建全宗信息", name = "map") @RequestBody Map<String,Object> map) {

        ResponseMsg<Boolean> responseMsg = null;
        try {
            responseMsg = new ResponseMsg<>();
            String orgId = (String) map.get("orgId");
            String sysId = (String) map.get("sysId");
            boolean b = this.lantopArchiveClassService.checkCurrentFonds(orgId, sysId);
            responseMsg.setResponseBody(b);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setRetCode("201");
            responseMsg.setErrorDesc(e.getMessage());
            e.printStackTrace();
        }
        return responseMsg;
    }

    /**
     * 验证同级别的节点名称是否已经存在
     * @param lantopArchiveClass
     * @return
     */
    @PostMapping("/checkExtName")
    @ApiOperation(value = "验证同级别的节点名称是否已经存在")
    public ResponseMsg<Boolean> checkExtName(@ApiParam(value = "验证同级别的节点名称是否已经存在", name = "lantopArchiveClass") @RequestBody LantopArchiveClassT lantopArchiveClass) {

        ResponseMsg<Boolean> responseMsg = null;
        try {
            responseMsg = null;
            lantopArchiveClassService.checkExtName(lantopArchiveClass);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setRetCode("201");
            responseMsg.setErrorDesc(e.getMessage());
            e.printStackTrace();
        }
        return responseMsg;
    }


    /**
     * 数据没有重复,调用添加方法
     * @param map
     */
    @PostMapping("/insertCommTempletInitFields")
    @ApiOperation(value = "数据没有重复,调用添加方法")
    public ResponseMsg insertCommTempletInitFields(@ApiParam(value = "数据没有重复,调用添加方法", name = "map") @RequestBody Map<String,Object> map) {
        ResponseMsg responseMsg = new ResponseMsg();
        try {
            CbbTempletField[] cbbTempltFields = (CbbTempletField[]) map.get("cbbTempltFields");
            String sysId = (String) map.get("sysId");
            String orgId = (String) map.get("orgId");
            String deptId = (String) map.get("deptId");
            String templetId = (String) map.get("templetId");
            commTempletManagerService.insertCommTempletInitFields(cbbTempltFields, sysId,orgId ,deptId, templetId);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setRetCode("201");
            responseMsg.setErrorDesc(e.getMessage());
            e.printStackTrace();
        }
        return responseMsg;
    }



    @PostMapping("/syncCbbTabColumns")
    @ApiOperation(value = "")
    public ResponseMsg syncCbbTabColumns(@ApiParam(value = "", name = "map") @RequestBody Map<String,Object> map) {
        ResponseMsg responseMsg = new ResponseMsg();
        try {
            String nodeId = (String) map.get("nodeId");
            List<String> orgIds = (List<String>) map.get("orgIds");
            lantopArchiveClassService2.syncCbbTabColumns(nodeId, orgIds);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setRetCode("201");
            responseMsg.setErrorDesc(e.getMessage());
            e.printStackTrace();
        }
        return responseMsg;
    }


    /**
     * 获得最大表名
     * @param map
     */
    @PostMapping("/getCbbMaxTableNameByNodeIdByIntfs")
    @ApiOperation(value = "获得最大表名")
    public ResponseMsg<String> getCbbMaxTableNameByNodeIdByIntfs(@ApiParam(value = "获得最大表名", name = "map") @RequestBody Map<String,Object> map) {
        ResponseMsg<String> responseMsg = new ResponseMsg<>();
        String cbbMaxTableNameByNodeIdByIntfs = null;
        try {
            String orgId = (String) map.get("orgId");
            String deptId = (String) map.get("deptId");
            String sysId = (String) map.get("sysId");
            String id = (String) map.get("id");
            cbbMaxTableNameByNodeIdByIntfs = commTableManagerIntfsService.getCbbMaxTableNameByNodeIdByIntfs(orgId, deptId, sysId, id);
            responseMsg.setResponseBody(cbbMaxTableNameByNodeIdByIntfs);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setRetCode("201");
            responseMsg.setErrorDesc(e.getMessage());
            e.printStackTrace();
        }
        return responseMsg;
    }

    /**
     * 根据节点ID，获取表IDS
     * @param map
     * @return
     */
    @PostMapping("/getCbbTableIdsByNodeIdByIntfs")
    @ApiOperation(value = "根据节点ID，获取表IDS")
    public ResponseMsg<List<Map<String, Object>>> getCbbTableIdsByNodeIdByIntfs(@ApiParam(value = "根据节点ID，获取表IDS", name = "map") @RequestBody Map<String,Object> map) {
        ResponseMsg<List<Map<String, Object>>> responseMsg = new ResponseMsg<>();
        List<Map<String, Object>> cbbTableIdsByNodeIdByIntfs = null;
        try {
            String orgId = (String) map.get("orgId");
            String deptId = (String) map.get("deptId");
            String sysId = (String) map.get("sysId");
            String modelId = (String) map.get("modelId");
            cbbTableIdsByNodeIdByIntfs = commTableManagerIntfsService.getCbbTableIdsByNodeIdByIntfs(orgId, deptId, sysId, modelId);
            responseMsg.setResponseBody(cbbTableIdsByNodeIdByIntfs);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setRetCode("201");
            responseMsg.setErrorDesc(e.getMessage());
            e.printStackTrace();
        }
        return responseMsg;
    }


    /**
     * 创建表与节点关联关系
     * @param map
     * @return
     */
    @PostMapping("/createCbbTabNodeByIntfs")
    @ApiOperation(value = "根据节点ID，获取表IDS")
    public ResponseMsg createCbbTabNodeByIntfs(@ApiParam(value = "根据节点ID，获取表IDS", name = "map") @RequestBody Map<String,Object> map) {
        ResponseMsg responseMsg = new ResponseMsg();
        try {
            String orgId = (String) map.get("orgId");
            String deptId = (String) map.get("deptId");
            String sysId = (String) map.get("sysId");
            String id = (String) map.get("id");
            String tableId = (String) map.get("tableId");
            String loginUserId = (String) map.get("loginUserId");
            String loginIp = (String) map.get("loginIp");
            Map<String, Object> param = (Map<String, Object>) map.get("param");
            commTableManagerIntfsService.createCbbTabNodeByIntfs(orgId, deptId, sysId, id, tableId, loginUserId, loginIp, param);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setRetCode("201");
            responseMsg.setErrorDesc(e.getMessage());
            e.printStackTrace();
        }
        return responseMsg;
    }


    /**
     * 获取表单排列数据
     * @param map
     * @return
     */
    @PostMapping("/getColumnPageMapItera")
    @ApiOperation(value = "获取表单排列数据")
    public ResponseMsg<Map<String, Object>> getColumnPageMapItera(@ApiParam(value = "获取表单排列数据", name = "map") @RequestBody Map<String,Object> map) {
        ResponseMsg<Map<String, Object>> responseMsg = new ResponseMsg<>();
        Map<String, Object> columnPageMapItera = null;
        try {
            Map<String, Object> colMap = (Map<String, Object>) map.get("colMap");
            List<Map<String, Object>> editList = (List<Map<String, Object>>) map.get("editList");
            columnPageMapItera = commTableManagerIntfsService.getColumnPageMapItera(colMap, editList);
            responseMsg.setRetCode("200");
            responseMsg.setResponseBody(columnPageMapItera);
        } catch (Exception e) {
            responseMsg.setRetCode("201");
            responseMsg.setErrorDesc(e.getMessage());
            e.printStackTrace();
        }
        return responseMsg;
    }


    /**
     * 获取表单排列数据
     * @param colMap
     * @return
     */
    @PostMapping("/getColumnPageMap")
    @ApiOperation(value = "获取表单排列数据")
    public ResponseMsg<Map<String, Object>> getColumnPageMap(@ApiParam(value = "获取表单排列数据", name = "colMap") @RequestBody Map<String,Object> colMap) {
        ResponseMsg<Map<String, Object>> responseMsg = new ResponseMsg<>();
        Map<String, Object> columnPageMap = null;
        try {
            columnPageMap = commTableManagerIntfsService.getColumnPageMap(colMap);
            responseMsg.setResponseBody(columnPageMap);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setRetCode("201");
            responseMsg.setErrorDesc(e.getMessage());
            e.printStackTrace();
        }
        return responseMsg;
    }


    /**
     * 获取档案分类树信息：树形展示（文件夹、模板、数据节点、物理表）
     * @param colMap
     * @return
     */
    @PostMapping("/getArchiveClassTreeNodeToTableInfoByIntfs")
    @ApiOperation(value = "获取表单排列数据")
    public ResponseMsg<List<TreeNode>> getArchiveClassTreeNodeToTableInfoByIntfs(@ApiParam(value = "获取表单排列数据", name = "colMap") @RequestBody Map<String,Object> colMap) {
        ResponseMsg<List<TreeNode>> responseMsg = new ResponseMsg<>();
        List<TreeNode> org_root = null;
        try {
            org_root = archiveClassManagerIntfsService.getArchiveClassTreeNodeToTableInfoByIntfs("ORG_ROOT", "");
            responseMsg.setResponseBody(org_root);
            responseMsg.setRetCode("201");
        } catch (Exception e) {
            responseMsg.setRetCode("201");
            responseMsg.setErrorDesc(e.getMessage());
            e.printStackTrace();
        }
        return responseMsg;
    }




    /**
     *获取数据排序字段
     * @param resMapsRb
     * @return
     */
    @PostMapping("/getColDataOrderByTableId/v1")
    @ApiOperation(value = "")
    public ResponseMsg<List<Map<String, Object>>> getColDataOrderByTableId(@ApiParam(value = "", name = "filevitalizationservice")@RequestBody Map<String,Object> resMapsRb) {
        ResponseMsg<List<Map<String, Object>>> responseMsg = new ResponseMsg<>();
        try {
            String tableId = (String) resMapsRb.get("tableId");
            String sysId = (String) resMapsRb.get("sysId");
            String orgId = (String) resMapsRb.get("orgId");
            String deptId = (String) resMapsRb.get("deptId");
            List<Map<String, Object>> getColDataOrderByTableId = commTableManagerIntfsService.getColDataOrderByTableId(tableId,sysId,orgId,deptId);
            responseMsg.setResponseBody(getColDataOrderByTableId);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setErrorDesc(e.getMessage());
            responseMsg.setRetCode("201");
            e.printStackTrace();
        }
        return responseMsg;
    }




//    /**
//     *
//     * @param resMapsRb
//     * @return
//     */
//    @PostMapping("/createCbbTabNodeByIntfs/v1")
//    @ApiOperation(value = "")
//    public ResponseMsg createCbbTabNodeByIntfs(@ApiParam(value = "", name = "filevitalizationservice")@RequestBody Map<String,Object> resMapsRb) {
//        ResponseMsg responseMsg = new ResponseMsg<>();
//        try {
//            String orgId = (String) resMapsRb.get("orgId");
//            String deptId = (String) resMapsRb.get("deptId");
//            String sysId = (String) resMapsRb.get("sysId");
//            String nodeId = (String) resMapsRb.get("nodeId");
//            String tableId = (String) resMapsRb.get("tableId");
//            String loginUserId = (String) resMapsRb.get("loginUserId");
//            String loginIp = (String) resMapsRb.get("loginIp");
//            Map<String, Object> param = (Map<String, Object>) resMapsRb.get("param");
//            commTableManagerIntfsService.createCbbTabNodeByIntfs(orgId,deptId,sysId,nodeId,tableId,loginUserId,loginIp,param);
//            responseMsg.setRetCode("200");
//        } catch (Exception e) {
//            responseMsg.setErrorDesc(e.getMessage());
//            responseMsg.setRetCode("201");
//            e.printStackTrace();
//        }
//        return responseMsg;
//    }




//    /**
//     *
//     * @param resMapsRb
//     * @return
//     */
//    @PostMapping("/getCbbTableIdsByNodeIdByIntfs/v1")
//    @ApiOperation(value = "")
//    public ResponseMsg<List<Map<String, Object>>> getCbbTableIdsByNodeIdByIntfs(@ApiParam(value = "", name = "filevitalizationservice")@RequestBody Map<String,Object> resMapsRb) {
//        ResponseMsg<List<Map<String, Object>>> responseMsg = new ResponseMsg<>();
//        try {
//            String orgId = (String) resMapsRb.get("orgId");
//            String deptId = (String) resMapsRb.get("deptId");
//            String sysId = (String) resMapsRb.get("sysId");
//            String nodeId = (String) resMapsRb.get("nodeId");
//            List<Map<String, Object>> getCbbTableIdsByNodeIdByIntfs = commTableManagerIntfsService.getCbbTableIdsByNodeIdByIntfs(orgId,deptId,sysId,nodeId);
//            responseMsg.setResponseBody(getCbbTableIdsByNodeIdByIntfs);
//            responseMsg.setRetCode("200");
//        } catch (Exception e) {
//            responseMsg.setErrorDesc(e.getMessage());
//            responseMsg.setRetCode("201");
//            e.printStackTrace();
//        }
//        return responseMsg;
//    }




    /**
     *获取某系统标识下已定义的所有物理表信息
     * @param resMapsRb
     * @return
     */
    @PostMapping("/getCbbAllTablesBySysIdByIntfs/v1")
    @ApiOperation(value = "")
    public ResponseMsg<List<Map<String, Object>>> getCbbAllTablesBySysIdByIntfs(@ApiParam(value = "", name = "filevitalizationservice")@RequestBody Map<String,Object> resMapsRb) {
        ResponseMsg<List<Map<String, Object>>> responseMsg = new ResponseMsg<>();
        try {
            String orgId = (String) resMapsRb.get("orgId");
            String deptId = (String) resMapsRb.get("deptId");
            String sysId = (String) resMapsRb.get("sysId");
            List<Map<String, Object>> getCbbAllTablesBySysIdByIntfs = commTableManagerIntfsService.getCbbAllTablesBySysIdByIntfs(orgId,deptId,sysId);
            responseMsg.setResponseBody(getCbbAllTablesBySysIdByIntfs);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setErrorDesc(e.getMessage());
            responseMsg.setRetCode("201");
            e.printStackTrace();
        }
        return responseMsg;
    }




    /**
     *创建节点著录定义
     * @param resMapsRb
     * @return
     */
    @PostMapping("/createCbbTabNodeRecordByIntfs/v1")
    @ApiOperation(value = "")
    public ResponseMsg createCbbTabNodeRecordByIntfs(@ApiParam(value = "", name = "filevitalizationservice")@RequestBody Map<String,Object> resMapsRb) {
        ResponseMsg responseMsg = new ResponseMsg<>();
        try {
            String orgId = (String) resMapsRb.get("orgId");
            String deptId = (String) resMapsRb.get("deptId");
            String sysId = (String) resMapsRb.get("sysId");
            String nodeId = (String) resMapsRb.get("nodeId");
            String tableId = (String) resMapsRb.get("tableId");
            commTableManagerIntfsService.createCbbTabNodeRecordByIntfs(orgId,deptId,sysId,nodeId,tableId);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setErrorDesc(e.getMessage());
            responseMsg.setRetCode("201");
            e.printStackTrace();
        }
        return responseMsg;
    }




    /**
     *创建库表
     * @param resMapsRb
     * @return
     */
    @PostMapping("/createCbbTableByIntfs/v1")
    @ApiOperation(value = "")
    public ResponseMsg createCbbTableByIntfs(@ApiParam(value = "", name = "filevitalizationservice")@RequestBody Map<String,Object> resMapsRb) {
        ResponseMsg responseMsg = new ResponseMsg<>();
        try {
            String orgId = (String) resMapsRb.get("orgId");
            String deptId = (String) resMapsRb.get("deptId");
            String sysId = (String) resMapsRb.get("sysId");
            String nodeId = (String) resMapsRb.get("nodeId");
            String nodeName = (String) resMapsRb.get("nodeName");
            String tabLevel = (String) resMapsRb.get("tabLevel");
            String moreLevelName = (String) resMapsRb.get("moreLevelName");
            String loginUserId = (String) resMapsRb.get("loginUserId");
            String loginIp = (String) resMapsRb.get("loginIp");
            Boolean ifTrue = (Boolean) resMapsRb.get("ifTrue");
            String nodeCode = (String) resMapsRb.get("nodeCode");
            Map<String, Object> param = (Map<String, Object>) resMapsRb.get("param");
            commTableManagerIntfsService.createCbbTableByIntfs(orgId,deptId,sysId,nodeId,nodeName,tabLevel,moreLevelName,loginUserId,loginIp,ifTrue,nodeCode,param);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setErrorDesc(e.getMessage());
            responseMsg.setRetCode("201");
            e.printStackTrace();
        }
        return responseMsg;
    }




    /**
     *节点著录定义添加字段信息
     * @param resMapsRb
     * @return
     */
    @PostMapping("/addCbbTabNodeRecordFieldByIntfs/v1")
    @ApiOperation(value = "")
    public ResponseMsg addCbbTabNodeRecordFieldByIntfs(@ApiParam(value = "", name = "filevitalizationservice")@RequestBody Map<String,Object> resMapsRb) {
        ResponseMsg responseMsg = new ResponseMsg<>();
        try {
            String orgId = (String) resMapsRb.get("orgId");
            String deptId = (String) resMapsRb.get("deptId");
            String sysId = (String) resMapsRb.get("sysId");
            String nodeId = (String) resMapsRb.get("nodeId");
            String tableId = (String) resMapsRb.get("tableId");
            String colId = (String) resMapsRb.get("colId");
            commTableManagerIntfsService.addCbbTabNodeRecordFieldByIntfs(orgId,deptId,sysId,nodeId,tableId,colId);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setErrorDesc(e.getMessage());
            responseMsg.setRetCode("201");
            e.printStackTrace();
        }
        return responseMsg;
    }




    /**
     *获取字段信息
     * @param resMapsRb
     * @return
     */
    @PostMapping("/getCbbTabColumnsByIntfs/v1")
    @ApiOperation(value = "")
    public ResponseMsg<List<Map<String, Object>>> getCbbTabColumnsByIntfs(@ApiParam(value = "", name = "filevitalizationservice")@RequestBody Map<String,Object> resMapsRb) {
        ResponseMsg<List<Map<String, Object>>> responseMsg = new ResponseMsg<>();
        try {
            String orgId = (String) resMapsRb.get("orgId");
            String deptId = (String) resMapsRb.get("deptId");
            String sysId = (String) resMapsRb.get("sysId");
            String nodeId = (String) resMapsRb.get("nodeId");
            String tableId = (String) resMapsRb.get("tableId");
            List<Map<String, Object>> getCbbTabColumnsByIntfs = commTableManagerIntfsService.getCbbTabColumnsByIntfs(orgId,deptId,sysId,nodeId,tableId);
            responseMsg.setResponseBody(getCbbTabColumnsByIntfs);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setErrorDesc(e.getMessage());
            responseMsg.setRetCode("201");
            e.printStackTrace();
        }
        return responseMsg;
    }




    /**
     *根据模版代码获取模版ID
     * @param resMapsRb
     * @return
     */
    @PostMapping("/getTempletIdByTempletCode/v1")
    @ApiOperation(value = "")
    public ResponseMsg<String> getTempletIdByTempletCode(@ApiParam(value = "", name = "filevitalizationservice")@RequestBody Map<String,Object> resMapsRb) {
        ResponseMsg<String> responseMsg = new ResponseMsg<>();
        try {
            String templetInfoCode = (String) resMapsRb.get("templetInfoCode");
            String getTempletIdByTempletCode = commTableManagerIntfsService.getTempletIdByTempletCode(templetInfoCode);
            responseMsg.setResponseBody(getTempletIdByTempletCode);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setErrorDesc(e.getMessage());
            responseMsg.setRetCode("201");
            e.printStackTrace();
        }
        return responseMsg;
    }




    /**
     *根据表ID，获取列信息
     * @param resMapsRb
     * @return
     */
    @PostMapping("/getCbbTabColumnsByIsAllByIntfs/v1")
    @ApiOperation(value = "")
    public ResponseMsg<List<Map<String, Object>>> getCbbTabColumnsByIsAllByIntfs(@ApiParam(value = "", name = "filevitalizationservice")@RequestBody Map<String,Object> resMapsRb) {
        ResponseMsg<List<Map<String, Object>>> responseMsg = new ResponseMsg<>();
        try {
            String orgId = (String) resMapsRb.get("orgId");
            String deptId = (String) resMapsRb.get("deptId");
            String sysId = (String) resMapsRb.get("sysId");
            String tableId = (String) resMapsRb.get("tableId");
            String isAll = (String) resMapsRb.get("isAll");
            List<Map<String, Object>> getCbbTabColumnsByIsAllByIntfs = commTableManagerIntfsService.getCbbTabColumnsByIsAllByIntfs(orgId,deptId,sysId,tableId,isAll);
            responseMsg.setResponseBody(getCbbTabColumnsByIsAllByIntfs);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setErrorDesc(e.getMessage());
            responseMsg.setRetCode("201");
            e.printStackTrace();
        }
        return responseMsg;
    }




//    /**
//     *
//     * @param resMapsRb
//     * @return
//     */
//    @PostMapping("/deleteCbbTableByNodeIdByIntfs/v1")
//    @ApiOperation(value = "")
//    public ResponseMsg deleteCbbTableByNodeIdByIntfs(@ApiParam(value = "", name = "filevitalizationservice")@RequestBody Map<String,Object> resMapsRb) {
//        ResponseMsg responseMsg = new ResponseMsg<>();
//        try {
//            String orgId = (String) resMapsRb.get("orgId");
//            String deptId = (String) resMapsRb.get("deptId");
//            String sysId = (String) resMapsRb.get("sysId");
//            String nodeId = (String) resMapsRb.get("nodeId");
//            String isTrueTable = (String) resMapsRb.get("isTrueTable");
//            commTableManagerIntfsService.deleteCbbTableByNodeIdByIntfs(orgId,deptId,sysId,nodeId,isTrueTable);
//            responseMsg.setRetCode("200");
//        } catch (Exception e) {
//            responseMsg.setErrorDesc(e.getMessage());
//            responseMsg.setRetCode("201");
//            e.printStackTrace();
//        }
//        return responseMsg;
//    }




    /**
     *拷贝库表
     * @param resMapsRb
     * @return
     */
    @PostMapping("/copyCbbTableByNodeIdByIntfs/v1")
    @ApiOperation(value = "")
    public ResponseMsg copyCbbTableByNodeIdByIntfs(@ApiParam(value = "", name = "filevitalizationservice")@RequestBody Map<String,Object> resMapsRb) {
        ResponseMsg responseMsg = new ResponseMsg<>();
        try {
            String orgId = (String) resMapsRb.get("orgId");
            String deptId = (String) resMapsRb.get("deptId");
            String sysId = (String) resMapsRb.get("sysId");
            String oldNodeId = (String) resMapsRb.get("oldNodeId");
            String newNodeId = (String) resMapsRb.get("newNodeId");
            String loginUserId = (String) resMapsRb.get("loginUserId");
            String loginIp = (String) resMapsRb.get("loginIp");
            Boolean ifTrue = (Boolean) resMapsRb.get("ifTrue");
            commTableManagerIntfsService.copyCbbTableByNodeIdByIntfs(orgId,deptId,sysId,oldNodeId,newNodeId,loginUserId,loginIp,ifTrue);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setErrorDesc(e.getMessage());
            responseMsg.setRetCode("201");
            e.printStackTrace();
        }
        return responseMsg;
    }




    /**
     *获取系统初始字段信息
     * @param resMapsRb
     * @return
     */
    @PostMapping("/getCbbSysInitFieldsByIntfs/v1")
    @ApiOperation(value = "")
    public ResponseMsg<List<Map<String, Object>>> getCbbSysInitFieldsByIntfs(@ApiParam(value = "", name = "filevitalizationservice")@RequestBody Map<String,Object> resMapsRb) {
        ResponseMsg<List<Map<String, Object>>> responseMsg = new ResponseMsg<>();
        try {
            String orgId = (String) resMapsRb.get("orgId");
            String deptId = (String) resMapsRb.get("deptId");
            String sysId = (String) resMapsRb.get("sysId");
            List<Map<String, Object>> getCbbSysInitFieldsByIntfs = commTableManagerIntfsService.getCbbSysInitFieldsByIntfs(orgId,deptId,sysId);
            responseMsg.setResponseBody(getCbbSysInitFieldsByIntfs);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setErrorDesc(e.getMessage());
            responseMsg.setRetCode("201");
            e.printStackTrace();
        }
        return responseMsg;
    }




    /**
     *根据标识条件，获取字段信息
     * @param resMapsRb
     * @return
     */
    @PostMapping("/getCbbFieldsByIsAllByIntfs/v1")
    @ApiOperation(value = "")
    public ResponseMsg<List<Map<String, Object>>> getCbbFieldsByIsAllByIntfs(@ApiParam(value = "", name = "filevitalizationservice")@RequestBody Map<String,Object> resMapsRb) {
        ResponseMsg<List<Map<String, Object>>> responseMsg = new ResponseMsg<>();
        try {
            String orgId = (String) resMapsRb.get("orgId");
            String deptId = (String) resMapsRb.get("deptId");
            String sysId = (String) resMapsRb.get("sysId");
            String tableName = (String) resMapsRb.get("tableName");
            String isAll = (String) resMapsRb.get("isAll");
            List<Map<String, Object>> getCbbFieldsByIsAllByIntfs = commTableManagerIntfsService.getCbbFieldsByIsAllByIntfs(orgId,deptId,sysId,tableName,isAll);
            responseMsg.setResponseBody(getCbbFieldsByIsAllByIntfs);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setErrorDesc(e.getMessage());
            responseMsg.setRetCode("201");
            e.printStackTrace();
        }
        return responseMsg;
    }




    /**
     *根据列ID，获取列信息
     * @param resMapsRb
     * @return
     */
    @PostMapping("/getCbbColumnsByColIdByIntfs/v1")
    @ApiOperation(value = "")
    public ResponseMsg<List<Map<String, Object>>> getCbbColumnsByColIdByIntfs(@ApiParam(value = "", name = "filevitalizationservice")@RequestBody Map<String,Object> resMapsRb) {
        ResponseMsg<List<Map<String, Object>>> responseMsg = new ResponseMsg<>();
        try {
            String colId = (String) resMapsRb.get("colId");
            List<Map<String, Object>> getCbbColumnsByColIdByIntfs = commTableManagerIntfsService.getCbbColumnsByColIdByIntfs(colId);
            responseMsg.setResponseBody(getCbbColumnsByColIdByIntfs);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setErrorDesc(e.getMessage());
            responseMsg.setRetCode("201");
            e.printStackTrace();
        }
        return responseMsg;
    }




    /**
     *根据列ID，获取该列的组合项配置信息
     * @param resMapsRb
     * @return
     */
    @PostMapping("/getColSearchByTableId/v1")
    @ApiOperation(value = "")
    public ResponseMsg<List<Map<String, Object>>> getColSearchByTableId(@ApiParam(value = "", name = "filevitalizationservice")@RequestBody Map<String,Object> resMapsRb) {
        ResponseMsg<List<Map<String, Object>>> responseMsg = new ResponseMsg<>();
        try {
            String tableId = (String) resMapsRb.get("tableId");
            List<Map<String, Object>> getColSearchByTableId = commTableManagerIntfsService.getColSearchByTableId(tableId);
            responseMsg.setResponseBody(getColSearchByTableId);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setErrorDesc(e.getMessage());
            responseMsg.setRetCode("201");
            e.printStackTrace();
        }
        return responseMsg;
    }




    /**
     *根据表ID，获取节点信息
     * @param resMapsRb
     * @return
     */
    @PostMapping("/getNodesByTableIdSysIdByIntfs/v1")
    @ApiOperation(value = "")
    public ResponseMsg<List<Map<String, Object>>> getNodesByTableIdSysIdByIntfs(@ApiParam(value = "", name = "filevitalizationservice")@RequestBody Map<String,Object> resMapsRb) {
        ResponseMsg<List<Map<String, Object>>> responseMsg = new ResponseMsg<>();
        try {
            String orgId = (String) resMapsRb.get("orgId");
            String deptId = (String) resMapsRb.get("deptId");
            String sysId = (String) resMapsRb.get("sysId");
            String tableId = (String) resMapsRb.get("tableId");
            List<Map<String, Object>> getNodesByTableIdSysIdByIntfs = commTableManagerIntfsService.getNodesByTableIdSysIdByIntfs(orgId,deptId,sysId,tableId);
            responseMsg.setResponseBody(getNodesByTableIdSysIdByIntfs);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setErrorDesc(e.getMessage());
            responseMsg.setRetCode("201");
            e.printStackTrace();
        }
        return responseMsg;
    }




    /**
     *根据节点ID，删除表与节点关联关系
     * @param resMapsRb
     * @return
     */
    @PostMapping("/deleteCbbTabNodeByNodeIdByIntfs/v1")
    @ApiOperation(value = "")
    public ResponseMsg deleteCbbTabNodeByNodeIdByIntfs(@ApiParam(value = "", name = "filevitalizationservice")@RequestBody Map<String,Object> resMapsRb) {
        ResponseMsg responseMsg = new ResponseMsg<>();
        try {
            String orgId = (String) resMapsRb.get("orgId");
            String deptId = (String) resMapsRb.get("deptId");
            String sysId = (String) resMapsRb.get("sysId");
            String nodeId = (String) resMapsRb.get("nodeId");
            commTableManagerIntfsService.deleteCbbTabNodeByNodeIdByIntfs(orgId,deptId,sysId,nodeId);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setErrorDesc(e.getMessage());
            responseMsg.setRetCode("201");
            e.printStackTrace();
        }
        return responseMsg;
    }




    /**
     *根据系统标识ID，表名，获取表ID
     * @param resMapsRb
     * @return
     */
    @PostMapping("/getCbbTableIdByIntfs/v1")
    @ApiOperation(value = "")
    public ResponseMsg<String> getCbbTableIdByIntfs(@ApiParam(value = "", name = "filevitalizationservice")@RequestBody Map<String,Object> resMapsRb) {
        ResponseMsg<String> responseMsg = new ResponseMsg<>();
        try {
            String orgId = (String) resMapsRb.get("orgId");
            String deptId = (String) resMapsRb.get("deptId");
            String sysId = (String) resMapsRb.get("sysId");
            String tableName = (String) resMapsRb.get("tableName");
            String getCbbTableIdByIntfs = commTableManagerIntfsService.getCbbTableIdByIntfs(orgId,deptId,sysId,tableName);
            responseMsg.setResponseBody(getCbbTableIdByIntfs);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setErrorDesc(e.getMessage());
            responseMsg.setRetCode("201");
            e.printStackTrace();
        }
        return responseMsg;
    }




//    /**
//     *
//     * @param resMapsRb
//     * @return
//     */
//    @PostMapping("/getCbbTableInfoByNodeIdByIntfs/v1")
//    @ApiOperation(value = "")
//    public ResponseMsg<List<Map<String, Object>>> getCbbTableInfoByNodeIdByIntfs(@ApiParam(value = "", name = "filevitalizationservice")@RequestBody Map<String,Object> resMapsRb) {
//        ResponseMsg<List<Map<String, Object>>> responseMsg = new ResponseMsg<>();
//        try {
//            String orgId = (String) resMapsRb.get("orgId");
//            String deptId = (String) resMapsRb.get("deptId");
//            String sysId = (String) resMapsRb.get("sysId");
//            String nodeId = (String) resMapsRb.get("nodeId");
//            String cbbTableIndex = (String) resMapsRb.get("cbbTableIndex");
//            List<Map<String, Object>> getCbbTableInfoByNodeIdByIntfs = commTableManagerIntfsService.getCbbTableInfoByNodeIdByIntfs(orgId,deptId,sysId,nodeId,cbbTableIndex);
//            responseMsg.setResponseBody(getCbbTableInfoByNodeIdByIntfs);
//            responseMsg.setRetCode("200");
//        } catch (Exception e) {
//            responseMsg.setErrorDesc(e.getMessage());
//            responseMsg.setRetCode("201");
//            e.printStackTrace();
//        }
//        return responseMsg;
//    }




    /**
     *获取表与节点关系ID
     * @param resMapsRb
     * @return
     */
    @PostMapping("/getCbbTabNodeIdByIntfs/v1")
    @ApiOperation(value = "")
    public ResponseMsg<String> getCbbTabNodeIdByIntfs(@ApiParam(value = "", name = "filevitalizationservice")@RequestBody Map<String,Object> resMapsRb) {
        ResponseMsg<String> responseMsg = new ResponseMsg<>();
        try {
            String orgId = (String) resMapsRb.get("orgId");
            String deptId = (String) resMapsRb.get("deptId");
            String sysId = (String) resMapsRb.get("sysId");
            String nodeId = (String) resMapsRb.get("nodeId");
            String tableId = (String) resMapsRb.get("tableId");
            String getCbbTabNodeIdByIntfs = commTableManagerIntfsService.getCbbTabNodeIdByIntfs(orgId,deptId,sysId,nodeId,tableId);
            responseMsg.setResponseBody(getCbbTabNodeIdByIntfs);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setErrorDesc(e.getMessage());
            responseMsg.setRetCode("201");
            e.printStackTrace();
        }
        return responseMsg;
    }




    /**
     *根据节点ID和表ID，删除表与节点关联关系
     * @param resMapsRb
     * @return
     */
    @PostMapping("/deleteCbbTabNodeByNodeIdAndTabIdByIntfs/v1")
    @ApiOperation(value = "")
    public ResponseMsg deleteCbbTabNodeByNodeIdAndTabIdByIntfs(@ApiParam(value = "", name = "filevitalizationservice")@RequestBody Map<String,Object> resMapsRb) {
        ResponseMsg responseMsg = new ResponseMsg<>();
        try {
            String orgId = (String) resMapsRb.get("orgId");
            String deptId = (String) resMapsRb.get("deptId");
            String sysId = (String) resMapsRb.get("sysId");
            String nodeId = (String) resMapsRb.get("nodeId");
            String tableId = (String) resMapsRb.get("tableId");
            commTableManagerIntfsService.deleteCbbTabNodeByNodeIdAndTabIdByIntfs(orgId,deptId,sysId,nodeId,tableId);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setErrorDesc(e.getMessage());
            responseMsg.setRetCode("201");
            e.printStackTrace();
        }
        return responseMsg;
    }




    /**
     *根据列ID，获取该列的组合项配置信息
     * @param resMapsRb
     * @return
     */
    @PostMapping("/getCbbColumnsConfigGropuAndSourceColNameByColIdByIntfs/v1")
    @ApiOperation(value = "")
    public ResponseMsg<List<Map<String, Object>>> getCbbColumnsConfigGropuAndSourceColNameByColIdByIntfs(@ApiParam(value = "", name = "filevitalizationservice")@RequestBody Map<String,Object> resMapsRb) {
        ResponseMsg<List<Map<String, Object>>> responseMsg = new ResponseMsg<>();
        try {
            String colId = (String) resMapsRb.get("colId");
            List<Map<String, Object>> getCbbColumnsConfigGropuAndSourceColNameByColIdByIntfs = commTableManagerIntfsService.getCbbColumnsConfigGropuAndSourceColNameByColIdByIntfs(colId);
            responseMsg.setResponseBody(getCbbColumnsConfigGropuAndSourceColNameByColIdByIntfs);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setErrorDesc(e.getMessage());
            responseMsg.setRetCode("201");
            e.printStackTrace();
        }
        return responseMsg;
    }




    /**
     *获取公共字段表中的字段信息
     * @param resMapsRb
     * @return
     */
    @PostMapping("/getPublicField/v1")
    @ApiOperation(value = "")
    public ResponseMsg<List<Map<String, Object>>> getPublicField(@ApiParam(value = "", name = "filevitalizationservice")@RequestBody Map<String,Object> resMapsRb) {
        ResponseMsg<List<Map<String, Object>>> responseMsg = new ResponseMsg<>();
        try {
            Map<String, Object> param = (Map<String, Object>) resMapsRb.get("param");
            List<Map<String, Object>> getPublicField = commTableManagerIntfsService.getPublicField(param);
            responseMsg.setResponseBody(getPublicField);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setErrorDesc(e.getMessage());
            responseMsg.setRetCode("201");
            e.printStackTrace();
        }
        return responseMsg;
    }




//    /**
//     *
//     * @param resMapsRb
//     * @return
//     */
//    @PostMapping("/getColumnPageMap/v1")
//    @ApiOperation(value = "")
//    public ResponseMsg<Map<String, Object>> getColumnPageMap(@ApiParam(value = "", name = "filevitalizationservice")@RequestBody Map<String,Object> resMapsRb) {
//        ResponseMsg<Map<String, Object>> responseMsg = new ResponseMsg<>();
//        try {
//            Map<String, Object> parameter = (Map<String, Object>) resMapsRb.get("parameter");
//            Map<String, Object> getColumnPageMap = commTableManagerIntfsService.getColumnPageMap(parameter);
//            responseMsg.setResponseBody(getColumnPageMap);
//            responseMsg.setRetCode("200");
//        } catch (Exception e) {
//            responseMsg.setErrorDesc(e.getMessage());
//            responseMsg.setRetCode("201");
//            e.printStackTrace();
//        }
//        return responseMsg;
//    }




    /**
     *我的订阅独有的查询公共字段方法
     * @param resMapsRb
     * @return
     */
    @PostMapping("/getCbbTableAndColumnsByTabNameByIntfsItera/v1")
    @ApiOperation(value = "我的订阅独有的查询公共字段方法")
    public ResponseMsg<List<Map<String, Object>>> getCbbTableAndColumnsByTabNameByIntfsItera(@ApiParam(value = "", name = "filevitalizationservice")@RequestBody Map<String,Object> resMapsRb) {
        ResponseMsg<List<Map<String, Object>>> responseMsg = new ResponseMsg<>();
        try {
            String orgId = (String) resMapsRb.get("orgId");
            String deptId = (String) resMapsRb.get("deptId");
            String sysId = (String) resMapsRb.get("sysId");
            String tableName = (String) resMapsRb.get("tableName");
            List<Map<String, Object>> getCbbTableAndColumnsByTabNameByIntfsItera = commTableManagerIntfsService.getCbbTableAndColumnsByTabNameByIntfsItera(orgId,deptId,sysId,tableName);
            responseMsg.setResponseBody(getCbbTableAndColumnsByTabNameByIntfsItera);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setErrorDesc(e.getMessage());
            responseMsg.setRetCode("201");
            e.printStackTrace();
        }
        return responseMsg;
    }




    /**
     *根据表名，获取表信息以及列信息
     * @param resMapsRb
     * @return
     */
    @PostMapping("/getCbbTableAndColumnsByTabNameByIntfs/v1")
    @ApiOperation(value = "根据表名，获取表信息以及列信息")
    public ResponseMsg<List<Map<String, Object>>> getCbbTableAndColumnsByTabNameByIntfs(@ApiParam(value = "", name = "filevitalizationservice")@RequestBody Map<String,Object> resMapsRb) {
        ResponseMsg<List<Map<String, Object>>> responseMsg = new ResponseMsg<>();
        try {
            String orgId = (String) resMapsRb.get("orgId");
            String deptId = (String) resMapsRb.get("deptId");
            String sysId = (String) resMapsRb.get("sysId");
            String tableName = (String) resMapsRb.get("tableName");
            List<Map<String, Object>> getCbbTableAndColumnsByTabNameByIntfs = commTableManagerIntfsService.getCbbTableAndColumnsByTabNameByIntfs(orgId,deptId,sysId,tableName);
            responseMsg.setResponseBody(getCbbTableAndColumnsByTabNameByIntfs);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setErrorDesc(e.getMessage());
            responseMsg.setRetCode("201");
            e.printStackTrace();
        }
        return responseMsg;
    }




    /**
     *只根据根据表名，获取表信息以及列信息
     * @param resMapsRb
     * @return
     */
    @PostMapping("/getCbbTableAndColumnsByOnlyTabNameByIntfs/v1")
    @ApiOperation(value = "")
    public ResponseMsg<List<Map<String, Object>>> getCbbTableAndColumnsByOnlyTabNameByIntfs(@ApiParam(value = "", name = "filevitalizationservice")@RequestBody Map<String,Object> resMapsRb) {
        ResponseMsg<List<Map<String, Object>>> responseMsg = new ResponseMsg<>();
        try {
            String tableName = (String) resMapsRb.get("tableName");
            List<Map<String, Object>> getCbbTableAndColumnsByOnlyTabNameByIntfs = commTableManagerIntfsService.getCbbTableAndColumnsByOnlyTabNameByIntfs(tableName);
            responseMsg.setResponseBody(getCbbTableAndColumnsByOnlyTabNameByIntfs);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setErrorDesc(e.getMessage());
            responseMsg.setRetCode("201");
            e.printStackTrace();
        }
        return responseMsg;
    }




    /**
     *根据列id和语言code获取 列名
     * @param resMapsRb
     * @return
     */
    @PostMapping("/getColumnLabelByColumnIdAndLanguageCode/v1")
    @ApiOperation(value = "根据列id和语言code获取 列名")
    public ResponseMsg<String> getColumnLabelByColumnIdAndLanguageCode(@ApiParam(value = "", name = "filevitalizationservice")@RequestBody Map<String,Object> resMapsRb) {
        ResponseMsg<String> responseMsg = new ResponseMsg<>();
        try {
            String columnId = (String) resMapsRb.get("columnId");
            String languageCode = (String) resMapsRb.get("languageCode");
            String getColumnLabelByColumnIdAndLanguageCode = commTableManagerIntfsService.getColumnLabelByColumnIdAndLanguageCode(columnId,languageCode);
            responseMsg.setResponseBody(getColumnLabelByColumnIdAndLanguageCode);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setErrorDesc(e.getMessage());
            responseMsg.setRetCode("201");
            e.printStackTrace();
        }
        return responseMsg;
    }




    /**
     *根据表ID级列英文名，获取列信息
     * @param resMapsRb
     * @return
     */
    @PostMapping("/getCbbColumnsByTableIdAndColNameByIntfs/v1")
    @ApiOperation(value = "")
    public ResponseMsg<List<Map<String, Object>>> getCbbColumnsByTableIdAndColNameByIntfs(@ApiParam(value = "", name = "filevitalizationservice")@RequestBody Map<String,Object> resMapsRb) {
        ResponseMsg<List<Map<String, Object>>> responseMsg = new ResponseMsg<>();
        try {
            String tableId = (String) resMapsRb.get("tableId");
            String colName = (String) resMapsRb.get("colName");
            List<Map<String, Object>> getCbbColumnsByTableIdAndColNameByIntfs = commTableManagerIntfsService.getCbbColumnsByTableIdAndColNameByIntfs(tableId,colName);
            responseMsg.setResponseBody(getCbbColumnsByTableIdAndColNameByIntfs);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setErrorDesc(e.getMessage());
            responseMsg.setRetCode("201");
            e.printStackTrace();
        }
        return responseMsg;
    }




//    /**
//     *
//     * @param resMapsRb
//     * @return
//     */
//    @PostMapping("/getCbbMaxTableNameByNodeIdByIntfs/v1")
//    @ApiOperation(value = "")
//    public ResponseMsg<String> getCbbMaxTableNameByNodeIdByIntfs(@ApiParam(value = "", name = "filevitalizationservice")@RequestBody Map<String,Object> resMapsRb) {
//        ResponseMsg<String> responseMsg = new ResponseMsg<>();
//        try {
//            String orgId = (String) resMapsRb.get("orgId");
//            String deptId = (String) resMapsRb.get("deptId");
//            String sysId = (String) resMapsRb.get("sysId");
//            String nodeId = (String) resMapsRb.get("nodeId");
//            String getCbbMaxTableNameByNodeIdByIntfs = commTableManagerIntfsService.getCbbMaxTableNameByNodeIdByIntfs(orgId,deptId,sysId,nodeId);
//            responseMsg.setResponseBody(getCbbMaxTableNameByNodeIdByIntfs);
//            responseMsg.setRetCode("200");
//        } catch (Exception e) {
//            responseMsg.setErrorDesc(e.getMessage());
//            responseMsg.setRetCode("201");
//            e.printStackTrace();
//        }
//        return responseMsg;
//    }




    /**
     *根据字段类型，获取系统初始字段信息
     * @param resMapsRb
     * @return
     */
    @PostMapping("/getCbbSysInitFieldsByColTypeByIntfs/v1")
    @ApiOperation(value = "根据字段类型，获取系统初始字段信息")
    public ResponseMsg<List<Map<String, Object>>> getCbbSysInitFieldsByColTypeByIntfs(@ApiParam(value = "", name = "filevitalizationservice")@RequestBody Map<String,Object> resMapsRb) {
        ResponseMsg<List<Map<String, Object>>> responseMsg = new ResponseMsg<>();
        try {
            String orgId = (String) resMapsRb.get("orgId");
            String deptId = (String) resMapsRb.get("deptId");
            String sysId = (String) resMapsRb.get("sysId");
            String colType = (String) resMapsRb.get("colType");
            List<Map<String, Object>> getCbbSysInitFieldsByColTypeByIntfs = commTableManagerIntfsService.getCbbSysInitFieldsByColTypeByIntfs(orgId,deptId,sysId,colType);
            responseMsg.setResponseBody(getCbbSysInitFieldsByColTypeByIntfs);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setErrorDesc(e.getMessage());
            responseMsg.setRetCode("201");
            e.printStackTrace();
        }
        return responseMsg;
    }




    /**
     *根据列ID，获取该列的组合项配置信息
     * @param resMapsRb
     * @return
     */
    @PostMapping("/getCbbColumnsConfigGropuByColIdByIntfs/v1")
    @ApiOperation(value = "根据列ID，获取该列的组合项配置信息")
    public ResponseMsg<List<Map<String, Object>>> getCbbColumnsConfigGropuByColIdByIntfs(@ApiParam(value = "", name = "filevitalizationservice")@RequestBody Map<String,Object> resMapsRb) {
        ResponseMsg<List<Map<String, Object>>> responseMsg = new ResponseMsg<>();
        try {
            String colId = (String) resMapsRb.get("colId");
            List<Map<String, Object>> getCbbColumnsConfigGropuByColIdByIntfs = commTableManagerIntfsService.getCbbColumnsConfigGropuByColIdByIntfs(colId);
            responseMsg.setResponseBody(getCbbColumnsConfigGropuByColIdByIntfs);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setErrorDesc(e.getMessage());
            responseMsg.setRetCode("201");
            e.printStackTrace();
        }
        return responseMsg;
    }




    /**
     *节点著录定义删除字段信息
     * @param resMapsRb
     * @return
     */
    @PostMapping("/deleteCbbTabNodeRecordFieldByIntfs/v1")
    @ApiOperation(value = "")
    public ResponseMsg deleteCbbTabNodeRecordFieldByIntfs(@ApiParam(value = "", name = "filevitalizationservice")@RequestBody Map<String,Object> resMapsRb) {
        ResponseMsg responseMsg = new ResponseMsg<>();
        try {
            String orgId = (String) resMapsRb.get("orgId");
            String deptId = (String) resMapsRb.get("deptId");
            String sysId = (String) resMapsRb.get("sysId");
            String nodeId = (String) resMapsRb.get("nodeId");
            String tableId = (String) resMapsRb.get("tableId");
            String colId = (String) resMapsRb.get("colId");
            commTableManagerIntfsService.deleteCbbTabNodeRecordFieldByIntfs(orgId,deptId,sysId,nodeId,tableId,colId);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setErrorDesc(e.getMessage());
            responseMsg.setRetCode("201");
            e.printStackTrace();
        }
        return responseMsg;
    }




    /**
     *根据表ID，获取表信息以及列信息
     * @param resMapsRb
     * @return
     */
    @PostMapping("/getCbbTableAndColumnsByTabIdByIntfs/v1")
    @ApiOperation(value = "")
    public ResponseMsg<List<Map<String, Object>>> getCbbTableAndColumnsByTabIdByIntfs(@ApiParam(value = "", name = "filevitalizationservice")@RequestBody Map<String,Object> resMapsRb) {
        ResponseMsg<List<Map<String, Object>>> responseMsg = new ResponseMsg<>();
        try {
            String tableId = (String) resMapsRb.get("tableId");
            List<Map<String, Object>> getCbbTableAndColumnsByTabIdByIntfs = commTableManagerIntfsService.getCbbTableAndColumnsByTabIdByIntfs(tableId);
            responseMsg.setResponseBody(getCbbTableAndColumnsByTabIdByIntfs);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setErrorDesc(e.getMessage());
            responseMsg.setRetCode("201");
            e.printStackTrace();
        }
        return responseMsg;
    }




    /**
     *根据表ID，列英文名集合，获取列信息
     * @param resMapsRb
     * @return
     */
    @PostMapping("/getCbbColumnsByTableIdAndColNameListByIntfs/v1")
    @ApiOperation(value = "根据表ID，列英文名集合，获取列信息")
    public ResponseMsg<List<Map<String, Object>>> getCbbColumnsByTableIdAndColNameListByIntfs(@ApiParam(value = "", name = "filevitalizationservice")@RequestBody Map<String,Object> resMapsRb) {
        ResponseMsg<List<Map<String, Object>>> responseMsg = new ResponseMsg<>();
        try {
            String tableId = (String) resMapsRb.get("tableId");
            List<String> colNameList = (List<String>) resMapsRb.get("colNameList");
            List<Map<String, Object>> getCbbColumnsByTableIdAndColNameListByIntfs = commTableManagerIntfsService.getCbbColumnsByTableIdAndColNameListByIntfs(tableId,colNameList);
            responseMsg.setResponseBody(getCbbColumnsByTableIdAndColNameListByIntfs);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setErrorDesc(e.getMessage());
            responseMsg.setRetCode("201");
            e.printStackTrace();
        }
        return responseMsg;
    }




//    /**
//     *
//     * @param resMapsRb
//     * @return
//     */
//    @PostMapping("/getColumnPageMapItera/v1")
//    @ApiOperation(value = "")
//    public ResponseMsg<Map<String, Object>> getColumnPageMapItera(@ApiParam(value = "", name = "filevitalizationservice")@RequestBody Map<String,Object> resMapsRb) {
//        ResponseMsg<Map<String, Object>> responseMsg = new ResponseMsg<>();
//        try {
//            Map<String, Object> paramMap = (Map<String, Object>) resMapsRb.get("paramMap");
//            List<Map<String, Object>> columnInfoMap = (List<Map<String, Object>>) resMapsRb.get("columnInfoMap");
//            Map<String, Object> getColumnPageMapItera = commTableManagerIntfsService.getColumnPageMapItera(paramMap,columnInfoMap);
//            responseMsg.setResponseBody(getColumnPageMapItera);
//            responseMsg.setRetCode("200");
//        } catch (Exception e) {
//            responseMsg.setErrorDesc(e.getMessage());
//            responseMsg.setRetCode("201");
//            e.printStackTrace();
//        }
//        return responseMsg;
//    }




    /**
     *根据列id获取当前列的通用代码值
     * @param resMapsRb
     * @return
     */
    @PostMapping("/getColumnLookupByColumnId/v1")
    @ApiOperation(value = "根据列id获取当前列的通用代码值")
    public ResponseMsg<Map<String, Object>> getColumnLookupByColumnId(@ApiParam(value = "", name = "filevitalizationservice")@RequestBody Map<String,Object> resMapsRb) {
        ResponseMsg<Map<String, Object>> responseMsg = new ResponseMsg<>();
        try {
            String orgId = (String) resMapsRb.get("orgId");
            String deptId = (String) resMapsRb.get("deptId");
            String sysId = (String) resMapsRb.get("sysId");
            Map<String, Object> param = (Map<String, Object>) resMapsRb.get("param");
            Map<String, Object> getColumnLookupByColumnId = commTableManagerIntfsService.getColumnLookupByColumnId(orgId,deptId,sysId,param);
            responseMsg.setResponseBody(getColumnLookupByColumnId);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setErrorDesc(e.getMessage());
            responseMsg.setRetCode("201");
            e.printStackTrace();
        }
        return responseMsg;
    }




    /**
     *通过参数获取表索引信息集合
     * @param resMapsRb
     * @return
     */
    @PostMapping("/getTableIndexByParam/v1")
    @ApiOperation(value = "通过参数获取表索引信息集合")
    public ResponseMsg<List<Map<String, Object>>> getTableIndexByParam(@ApiParam(value = "", name = "filevitalizationservice")@RequestBody Map<String,Object> resMapsRb) {
        ResponseMsg<List<Map<String, Object>>> responseMsg = new ResponseMsg<>();
        try {
            Map<String, Object> param = (Map<String, Object>) resMapsRb.get("param");
            List<Map<String, Object>> getTableIndexByParam = commTableManagerIntfsService.getTableIndexByParam(param);
            responseMsg.setResponseBody(getTableIndexByParam);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setErrorDesc(e.getMessage());
            responseMsg.setRetCode("201");
            e.printStackTrace();
        }
        return responseMsg;
    }




    /**
     *根据tableId 和 生成方式获取列信息
     * @param resMapsRb
     * @return
     */
    @PostMapping("/getColumnsByParam/v1")
    @ApiOperation(value = "根据tableId 和 生成方式获取列信息")
    public ResponseMsg<List<Map<String, Object>>> getColumnsByParam(@ApiParam(value = "", name = "filevitalizationservice")@RequestBody Map<String,Object> resMapsRb) {
        ResponseMsg<List<Map<String, Object>>> responseMsg = new ResponseMsg<>();
        try {
            Map<String, Object> param = (Map<String, Object>) resMapsRb.get("param");
            List<Map<String, Object>> getColumnsByParam = commTableManagerIntfsService.getColumnsByParam(param);
            responseMsg.setResponseBody(getColumnsByParam);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setErrorDesc(e.getMessage());
            responseMsg.setRetCode("201");
            e.printStackTrace();
        }
        return responseMsg;
    }




    /**
     *查询当前组织下公共字段中所有字段的通用代码值
     * @param resMapsRb
     * @return
     */
    @PostMapping("/getColumnLookupByPublicTable/v1")
    @ApiOperation(value = "查询当前组织下公共字段中所有字段的通用代码值")
    public ResponseMsg<Map<String, Map<String, String>>> getColumnLookupByPublicTable(@ApiParam(value = "", name = "filevitalizationservice")@RequestBody Map<String,Object> resMapsRb) {
        ResponseMsg<Map<String, Map<String, String>>> responseMsg = new ResponseMsg<>();
        try {
            String orgId = (String) resMapsRb.get("orgId");
            String deptId = (String) resMapsRb.get("deptId");
            String sysId = (String) resMapsRb.get("sysId");
            Map<String, Object> param = (Map<String, Object>) resMapsRb.get("param");
            Map<String, Map<String, String>> getColumnLookupByPublicTable = commTableManagerIntfsService.getColumnLookupByPublicTable(orgId,deptId,sysId,param);
            responseMsg.setResponseBody(getColumnLookupByPublicTable);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setErrorDesc(e.getMessage());
            responseMsg.setRetCode("201");
            e.printStackTrace();
        }
        return responseMsg;
    }




    /**
     *根据表ID查询表下所有字段的通用代码值
     * @param resMapsRb
     * @return
     */
    @PostMapping("/getColumnLookupByTableId/v1")
    @ApiOperation(value = "根据表ID查询表下所有字段的通用代码值")
    public ResponseMsg<Map<String, Map<String, String>>> getColumnLookupByTableId(@ApiParam(value = "", name = "filevitalizationservice")@RequestBody Map<String,Object> resMapsRb) {
        ResponseMsg<Map<String, Map<String, String>>> responseMsg = new ResponseMsg<>();
        try {
            String orgId = (String) resMapsRb.get("orgId");
            String deptId = (String) resMapsRb.get("deptId");
            String sysId = (String) resMapsRb.get("sysId");
            String tableId = (String) resMapsRb.get("tableId");
            Map<String, Object> param = (Map<String, Object>) resMapsRb.get("param");
            Map<String, Map<String, String>> getColumnLookupByTableId = commTableManagerIntfsService.getColumnLookupByTableId(orgId,deptId,sysId,tableId,param);
            responseMsg.setResponseBody(getColumnLookupByTableId);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setErrorDesc(e.getMessage());
            responseMsg.setRetCode("201");
            e.printStackTrace();
        }
        return responseMsg;
    }




    /**
     *检查对应模版类型是否存在相同字段
     * @param resMapsRb
     * @return
     */
    @PostMapping("/checkTemplateFieldsRepeat/v1")
    @ApiOperation(value = "检查对应模版类型是否存在相同字段")
    public ResponseMsg<String> checkTemplateFieldsRepeat(@ApiParam(value = "", name = "filevitalizationservice")@RequestBody Map<String,Object> resMapsRb) {
        ResponseMsg<String> responseMsg = new ResponseMsg<>();
        try {
            Map<String, Object> param = (Map<String, Object>) resMapsRb.get("param");
            String checkTemplateFieldsRepeat = commTableManagerIntfsService.checkTemplateFieldsRepeat(param);
            responseMsg.setResponseBody(checkTemplateFieldsRepeat);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setErrorDesc(e.getMessage());
            responseMsg.setRetCode("201");
            e.printStackTrace();
        }
        return responseMsg;
    }




    /**
     *根据表ID，获取列信息
     * @param resMapsRb
     * @return
     */
    @PostMapping("/getCbbTabColumnsByMap/v1")
    @ApiOperation(value = "根据表ID，获取列信息")
    public ResponseMsg<List<Map<String, Object>>> getCbbTabColumnsByMap(@ApiParam(value = "", name = "filevitalizationservice")@RequestBody Map<String,Object> resMapsRb) {
        ResponseMsg<List<Map<String, Object>>> responseMsg = new ResponseMsg<>();
        try {
            String orgId = (String) resMapsRb.get("orgId");
            String deptId = (String) resMapsRb.get("deptId");
            String sysId = (String) resMapsRb.get("sysId");
            String tableId = (String) resMapsRb.get("tableId");
            Map<String, Object> map = (Map<String, Object>) resMapsRb.get("map");
            List<Map<String, Object>> getCbbTabColumnsByMap = commTableManagerIntfsService.getCbbTabColumnsByMap(orgId,deptId,sysId,tableId,map);
            responseMsg.setResponseBody(getCbbTabColumnsByMap);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setErrorDesc(e.getMessage());
            responseMsg.setRetCode("201");
            e.printStackTrace();
        }
        return responseMsg;
    }




    /**
     *获取排序主表信息（分页）
     * @param resMapsRb
     * @return
     */
    @PostMapping("/getPageTabSortList/v1")
    @ApiOperation(value = "获取排序主表信息（分页）")
    public ResponseMsg<Page<Map<String, Object>>> getPageTabSortList(@ApiParam(value = "", name = "filevitalizationservice")@RequestBody Map<String,Object> resMapsRb) {
        ResponseMsg<Page<Map<String, Object>>> responseMsg = new ResponseMsg<>();
        try {
            Integer pageNo = (Integer) resMapsRb.get("pageNo");
            Integer pageSize = (Integer) resMapsRb.get("pageSize");
            Map<String, Object> parameter = (Map<String, Object>) resMapsRb.get("parameter");
            Page<Map<String, Object>> getPageTabSortList = commTableManagerIntfsService.getPageTabSortList(pageNo,pageSize,parameter);
            responseMsg.setResponseBody(getPageTabSortList);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setErrorDesc(e.getMessage());
            responseMsg.setRetCode("201");
            e.printStackTrace();
        }
        return responseMsg;
    }




    /**
     *根据tableId 和 生成方式获取列信息
     * @param resMapsRb
     * @return
     */
    @PostMapping("/getColumnsByParameter/v1")
    @ApiOperation(value = "根据tableId 和 生成方式获取列信息")
    public ResponseMsg<List<Map<String, Object>>> getColumnsByParameter(@ApiParam(value = "", name = "filevitalizationservice")@RequestBody Map<String,Object> resMapsRb) {
        ResponseMsg<List<Map<String, Object>>> responseMsg = new ResponseMsg<>();
        try {
            Map<String, Object> param = (Map<String, Object>) resMapsRb.get("param");
            List<Map<String, Object>> getColumnsByParameter = commTableManagerIntfsService.getColumnsByParameter(param);
            responseMsg.setResponseBody(getColumnsByParameter);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setErrorDesc(e.getMessage());
            responseMsg.setRetCode("201");
            e.printStackTrace();
        }
        return responseMsg;
    }




    /**
     *根据表名，获取表ID
     * @param resMapsRb
     * @return
     */
    @PostMapping("/getCbbTableIdByTableNameIntfs/v1")
    @ApiOperation(value = "根据表名，获取表ID")
    public ResponseMsg<String> getCbbTableIdByTableNameIntfs(@ApiParam(value = "", name = "filevitalizationservice")@RequestBody Map<String,Object> resMapsRb) {
        ResponseMsg<String> responseMsg = new ResponseMsg<>();
        try {
            String tableName = (String) resMapsRb.get("tableName");
            String getCbbTableIdByTableNameIntfs = commTableManagerIntfsService.getCbbTableIdByTableNameIntfs(tableName);
            responseMsg.setResponseBody(getCbbTableIdByTableNameIntfs);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setErrorDesc(e.getMessage());
            responseMsg.setRetCode("201");
            e.printStackTrace();
        }
        return responseMsg;
    }


    /**
     * 获取选中节点和节点下子节点数据
     * @param resMapsRb
     * @return
     */
    @PostMapping("/getSelectNodeChild/v1")
    @ApiOperation(value = "获取选中节点和节点下子节点数据")
    public ResponseMsg<List<Map<String, Object>>> getSelectNodeChild(@ApiParam(value = "获取选中节点和节点下子节点数据", name = "filevitalizationservice")@RequestBody Map<String,Object> resMapsRb) {
        ResponseMsg<List<Map<String, Object>>> responseMsg = new ResponseMsg<>();
        try {
            String orgId = (String) resMapsRb.get("orgId");
            String deptId = (String) resMapsRb.get("deptId");
            String sysId = (String) resMapsRb.get("sysId");
            String targetNodeId = (String) resMapsRb.get("targetNodeId");
            List<Map<String, Object>> selectNodeChild = archiveClassManagerIntfsService.getSelectNodeChild(orgId, deptId, sysId, targetNodeId);
            responseMsg.setResponseBody(selectNodeChild);
            responseMsg.setRetCode("200");
        } catch (Exception e) {
            responseMsg.setErrorDesc(e.getMessage());
            responseMsg.setRetCode("201");
            e.printStackTrace();
        }
        return responseMsg;
    }



}
